package com.jie.component.exception.base;

import cn.hutool.core.util.StrUtil;
import com.jie.component.exception.enums.FrameError;
import lombok.Getter;

/**
 * @author jie
 * @version 1.0 2025-02-10 框架异常
 */
@Getter
public class FrameException extends BaseException {

    private final Integer code;

    private final String msg;

    public FrameException(FrameError error) {
        this.msg = error.getMsg();
        this.code = error.getCode();
    }

    @Override
    public String toString() {
        return StrUtil.format("系统异常信息 {}， 异常代码 {}", this.msg, this.code);
    }
}
